#include <string>

using namespace std;

// Product
class Product {
public:
        virtual size_t getWordsCount(string data) = 0;
};


// Creator
class Creator {
public:
        virtual Product* factoryMethod() = 0;
};

class TxtFile : public Product
{
public:
        size_t getWordsCount(string data);
};

class XmlFile: public Product
{
public:
        size_t getWordsCount(string data);
};

// ConcreteCreatorA
class ConcreteCreatorA : public Creator {
public:
        Product* factoryMethod() {
                return new TxtFile();
        }
};

// ConcreteCreatorB
class ConcreteCreatorB : public Creator {
public:
        Product* factoryMethod() {
                return new XmlFile();
        }
};

